import Vue from 'vue'
import Vuex from 'vuex'
import mutations from './mutations'
import actions from './actions'
import getters from './getters'
// 安装插件
Vue.use(Vuex)

// 实例的根对象 存储数据
const state = { cartList: [] }
// 创建 store 对象
const store = new Vuex.Store({
  state,
  mutations,
  actions,
  getters
})
// 挂载到实例
export default store
